package com.guanyu.u2cache.model;

import com.guanyu.u2cache.cache.Level1ToLevel2Cache;
import lombok.Builder;
import lombok.Getter;
import lombok.Setter;

/**
 * @author zhouyunjian
 * @date 2023/12/06 11:34
 **/
@Builder
@Setter
@Getter
public class CacheConsistence {

    private String[] cacheNames;
    private String key;
    private int failCount = 0;
    private Level1ToLevel2Cache level1ToLevel2Cache;


    public void invoke() {
        this.level1ToLevel2Cache.clear(this.cacheNames, this.key);
    }

    public void addFailCount() {
        this.failCount = failCount + 1;
    }
}
